package org.liziing.shortlink.project.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * 初始化限流配置
 */
@Component
public class SentinelRuleConfig implements InitializingBean {

    @Override
    public void afterPropertiesSet() throws Exception {
//        List<FlowRule> rules = new ArrayList<>();
//        FlowRule createOrderRule = new FlowRule();
//        createOrderRule.setResource("create_short-link");
//        createOrderRule.setGrade(RuleConstant.FLOW_GRADE_QPS);
//        createOrderRule.setCount(1);
//        rules.add(createOrderRule);
//        FlowRuleManager.loadRules(rules);
    }
}